Skip to content

Let a653lib support APEX-enabled Wasm 'partitions', executing in either Wasmtime or WAMR#11

Merged
nbaerair merged 4 commits into
airbus:mainfrom
psiegl:wasm-runtime
Jun 8, 2026
Merged

Let a653lib support APEX-enabled Wasm 'partitions', executing in either Wasmtime or WAMR#11
nbaerair merged 4 commits into
airbus:mainfrom
psiegl:wasm-runtime

Conversation

@psiegl

@psiegl psiegl commented Oct 6, 2025

Copy link
Copy Markdown
Contributor

This code works currently on ArchLinux (and Ubuntu - see CI):
$ yay -S clang lld wasi-libc wasi-compiler-rt libwasmtime iwasm
iwasm PKGBUILD must be patched to not strip the static library. See https://aur.archlinux.org/packages/iwasm

Content:
The given code showcases that a Wasmtime and WebAssembly Micro Runtime (WAMR) can support ARINC653 APEX interfaces as host functions. The PoC shall also proof, that it could work on Little Endian as well as Big Endian architectures (such as PowerPC still represented in avionics). There are a few caveats why ARINC653 APEX interfaces can't be 100% compliant to the WebAssembly standard, however the main language C (and C++) is supported and Ada should be supportable:

  1. APEX interfaces defined in WIT will not generate the proper APEX standardised function defintion through wit-bindgen. Thus, the APEX interface is exposed as a plain C header, where to-be-Wasm-ised source code can be directly compiled against.
  2. CREATE_PROCESS() and CREATE_ERROR_HANDLER() can't comply to the WebAssembly standard, as they pass a function pointer SYSTEM_ADDRESS_TYPE.
  3. WebAssembly defines that values returned are passed through a host functions return .... Meaning, function parameteres are 'just' input. However, the APEX interfaces all use plain pointers as function parameters to return content.

Again, as long as C, C++, Ada are the main languages, above points should be no worry.

Open Topics:

  1. Fix NixOS CI builds (currently this code works on Ubuntu and ArchLinux)
  2. Use better threading: DLR-FT/arinc653-wasm@main...dev/add-wasm-apex-proc-alloc

Choosing WebAssembly runtime
The compilation will create a bin folder. Change the symlink from p_wasmtime to p_wamr if WAMR shall be employed.

WebAssembly Specification

https://www.w3.org/TR/wasm-core-2/#concepts%E2%91%A0

"Each function takes a sequence of values as parameters and returns a sequence of values as results."

https://www.w3.org/TR/wasm-core-2/#function-instances%E2%91%A0

"A host function is a function expressed outside WebAssembly but passed to a module as an import. The definition and behavior of host functions are outside the scope of this specification."

https://www.w3.org/TR/wasm-core-2/#functions%E2%91%A4

@psiegl psiegl force-pushed the wasm-runtime branch 2 times, most recently from df4fe50 to bf877c4 Compare October 6, 2025 19:32
@psiegl psiegl marked this pull request as draft October 6, 2025 19:38
@psiegl psiegl force-pushed the wasm-runtime branch 14 times, most recently from 50f9627 to 6904674 Compare October 13, 2025 17:19
@psiegl psiegl force-pushed the wasm-runtime branch 4 times, most recently from b306875 to 1cebfe6 Compare October 17, 2025 22:32
@psiegl psiegl force-pushed the wasm-runtime branch 8 times, most recently from 47e396b to f21e9c6 Compare October 24, 2025 17:58
@psiegl psiegl changed the title [WIP] Enable ARINC653 interface of a653lib within a custom Wasmtime CLI [WIP] Enable ARINC653 interface within custom Wasmtime / WAMR CLI Nov 9, 2025
@psiegl psiegl changed the title [WIP] Enable ARINC653 interface within custom Wasmtime / WAMR CLI [WIP] Enable ARINC653 interface within both Wasmtime / WAMR custom CLI Nov 9, 2025
@psiegl psiegl force-pushed the wasm-runtime branch 3 times, most recently from 41d241f to ed50347 Compare November 11, 2025 22:26
@psiegl psiegl force-pushed the wasm-runtime branch 8 times, most recently from 75d6f58 to 9018c58 Compare May 21, 2026 21:18
@psiegl psiegl force-pushed the wasm-runtime branch 2 times, most recently from f1c8434 to cbea62f Compare May 27, 2026 18:09
@psiegl psiegl changed the title [WIP] Enable ARINC653 interface within both Wasmtime / WAMR custom CLI Let a653lib support APEX-enabled Wasm 'partitions', executing in either Wasmtime or WAMR May 27, 2026
@psiegl psiegl marked this pull request as ready for review May 27, 2026 18:15
@psiegl psiegl force-pushed the wasm-runtime branch 2 times, most recently from 6830bc5 to 1a34494 Compare May 30, 2026 20:59
@psiegl

This comment was marked as outdated.

@psiegl

psiegl commented May 31, 2026

Copy link
Copy Markdown
Contributor Author

@nic FYI

@psiegl

psiegl commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

All required patches put into PR for DLR-FT/arinc653-wasm:
DLR-FT/arinc653-wasm#37

@psiegl

psiegl commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

@nbaerair there are still some "nice to haves", however for the moment being I guess it is good enough to get it upstreamed.

@nbaerair nbaerair merged commit 5256ae9 into airbus:main Jun 8, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants